<?php

use think\facade\Route;

//物联网平台
Route::group('iot',function () {
    $prefix = 'iot.setting.';
    //选项设置
    Route::group('setting', function () {
        /*功能室分组管理*/
        Route::post('add_grouping', 'addGrouping'); //添加功能室分组
        Route::post('grouping_is_show', 'isShow')->append(['type'=>'grouping']); //设置是否启动
        Route::post('get_grouping_list', 'getGroupingList'); //获取功能室分组列表
        Route::post('get_grouping_all_data', 'getAllData')->append(['type'=>'grouping']); //获取功能室分组所有ID
        Route::post('del_grouping', 'delGrouping'); //删除功能室分组
        Route::post('edit_grouping', 'editGrouping'); //编辑功能室分组

        /*功能室设置*/
        Route::post('add_function_room', 'addFunctionRoom'); //添加功能室
        Route::post('function_room_is_show', 'isShow')->append(['type'=>'function_room']); //设置是否启动
        Route::post('get_function_room_list', 'getFunctionRoomList'); //获取功能室列表
        Route::post('get_function_room_all_data', 'getAllData')->append(['type'=>'function_room']); //获取功能室所有ID
        Route::post('del_function_room', 'delFunctionRoom'); //删除功能室
        Route::post('edit_function_room', 'editFunctionRoom'); //编辑功能室

    })->prefix($prefix.'Setting/');

    $consultantPrefix = 'iot.equipment_management.';
    /*物联网设备管理*/
    Route::group('equipmentManagement', function () {
        Route::post('get_unit_list', 'getUnitList'); //获取单位联动器

        Route::post('get_room_list', 'getRoomList'); //获取功能室列表
        Route::post('get_room_device', 'getRoomDevice'); //获取功能室设备列表
        Route::post('get_device_list', 'getDeviceList'); //获取设备列表
        Route::post('get_device_all_data', 'getDeviceAllData'); //获取设备列表所有ID
        Route::post('get_device_info', 'getDeviceInfo'); //获取设备基本情况
        Route::post('get_device_users', 'getDeviceUsers'); //获取设备的用户列表
        Route::post('get_class_list', 'getClassList'); //获取设备的班级
        Route::post('get_usage_record', 'getUsageRecord'); //获取设备用户的使用记录
        Route::post('get_user_details', 'getUserDetails'); //获取用户使用记录
    })->prefix($consultantPrefix.'EquipmentManagement/');

    /*统计*/
    $statistics = 'iot.statistics.';
    Route::group('statisticsDate', function () {
        Route::post('number_of_devices', 'numberOfDevices'); //获取设备数量
        Route::post('iot_overview', 'iotOverview'); //物联网数据概况
        Route::post('module_monitoring', 'moduleMonitoring'); //功能模块监测统计
        Route::post('user_device_statistic', 'userDeviceStatistic'); //各设备用户占比统计
        Route::post('ranking', 'Ranking'); //功能室使用排行
    })->prefix($statistics.'StatisticsDate/');
});

//区域用户档案
Route::group('user_profile',function () {

    /*查阅档案登记*/
    $consultantPrefix = 'user_profile.registration.';
    Route::group('registration', function () {
        Route::post('get_unit_list', 'getUnitList'); //获取单位联动器

        Route::post('add_record', 'addRecord'); //添加登记记录
        Route::post('record_list', 'recordList'); //登记记录列表
        Route::post('refresh_record', 'refreshRecord'); //刷新权限
    })->prefix($consultantPrefix.'Registration/');

    /*用户档案库*/
    $Archive = 'user_profile.userArchive.';
    Route::group('userArchive', function () {
        Route::post('get_list', 'getList'); //获取档案列表
        Route::post('get_permission', 'getPermission'); //获取查阅权限
        Route::post('get_class', 'getClass'); //部门选择-树结构

        //用户基本信息
        $selfTesting = 'user_profile.userArchive.basicInfo.';
        Route::group('basicInfo', function () {
            Route::post('export_basic_info', 'exportBasicInfo'); //导出基础资料
        })->prefix($selfTesting.'BasicInfo/');

        //个人自评档案
        $selfTesting = 'user_profile.userArchive.selfTesting.';
        Route::group('selfTesting', function () {
            Route::post('get_overview', 'getOverview'); //自评档案概况
            Route::post('get_recode', 'getRecode'); //个人自评记录
        })->prefix($selfTesting.'SelfTesting/');

        //危机干预档案
        $selfTesting = 'user_profile.userArchive.crisisTesting.';
        Route::group('crisisTesting', function () {
            Route::post('get_overview', 'getOverview'); //危机干预概况
            Route::post('get_recode', 'getRecode'); //危机干预记录
        })->prefix($selfTesting.'CrisisTesting/');

        //咨询预约档案
        $selfTesting = 'user_profile.userArchive.psychologicalCounseling.';
        Route::group('psychologicalCounseling', function () {
            Route::post('get_overview', 'getOverview'); //咨询预约概况
            Route::post('get_online_recode', 'getOnlineRecode'); //线上咨询记录
            Route::post('get_offline_recode', 'getOfflineRecode'); //线下预约记录
        })->prefix($selfTesting.'PsychologicalCounseling/');

        //测评档案
        $selfTesting = 'user_profile.userArchive.evaluationArchive.';
        Route::group('evaluationArchive', function () {
            Route::post('get_overview', 'getOverview'); //测评档案概况
            Route::post('get_self_recode', 'getSelfRecode'); //自我测评记录
            Route::post('get_task_recode', 'getTaskRecode'); //任务测评记录
            Route::post('get_proxy_recode', 'getProxyRecode'); //他人测评记录
            Route::post('get_wireless_recode', 'getWirelessRecode'); //无线测评记录
        })->prefix($selfTesting.'EvaluationArchive/');

        Route::post('is_show', 'isShow'); //显示隐藏【正常档案与废弃档案的左边的三级菜单显示与隐藏】

    })->prefix($Archive.'UserArchive/');

    /*废除档案库*/
    $repealArchivePrefix = 'user_profile.repealArchive.';
    Route::group('repealArchive', function () {
        Route::post('record_list', 'recordList'); //废除档案库列表
        Route::post('record_list_all', 'recordListAll'); //废除档案库列表所有数据ID
    })->prefix($repealArchivePrefix.'RepealArchive/');

});

//区域用户管理
Route::group('user',function () {
    //区域所有用户列表
    $prefix = 'user';
    //主页
    Route::group('index', function () {
        Route::post('index', 'Index'); //主页
    })->prefix($prefix.'.list.Index/');
    Route::group('list', function () {
        Route::post('download_template', 'downloadTemplate'); //下载模板
        Route::post('role_selector', 'roleSelector'); //角色选择器
        Route::post('user_list', 'userList'); //普通用户列表
        Route::post('consultant_list', 'consultantList'); //咨询师列表
        Route::post('admin_list', 'adminList'); //管理员列表
        Route::post('super_admin_list', 'SuperAdminList'); //超级管理员列表
        Route::post('super_admin_add', 'SuperAdminAdd'); //超级管理员-添加
        Route::post('prohibit_login', 'prohibitLogin'); //禁止登录
        Route::post('add', 'add'); //添加账号
        Route::post('update', 'update'); //编辑账号
        Route::post('del', 'del'); //删除账号
        Route::post('user_import', 'userImport'); //导入用户
        Route::post('user_export', 'UserExport'); //批量导出普通用户
        Route::post('consult_export', 'ConsultExport'); //批量导出咨询师
        Route::post('admin_export', 'AdminExport'); //批量导出管理员
    })->prefix($prefix.'.list.UserList/');
    //区域用户数据统计
    Route::group('statistics', function () {
        Route::post('number_people', 'NumberPeople'); //用户比例统计
        Route::post('online', 'online'); //用户在线活跃度
        Route::post('other', 'other'); //其他数据统计
        Route::post('disability', 'disability'); //残疾用户数据统计
        Route::post('age', 'age'); //用户年龄段细分
        Route::post('learning_stage', 'LearningStage'); //所在年段分布
        Route::post('department', 'department'); //部门
    })->prefix($prefix.'.statistics.Index/');
    //配置
    Route::group('config', function () {
        Route::post('selector2', 'selector2'); //部门选择器2
        Route::post('department', 'department'); //部门
        Route::post('get_config', 'getConfig'); //获取系统设置参数
        Route::post('department_level_list', 'departmentLevelList'); //部门等级规则列表
        Route::post('admin_user_list', 'adminUserList'); //指定部门管理员选项列表
        Route::post('department_selector', 'departmentSelector'); //部门选择器
        Route::post('user_senior_export', 'userSeniorExport'); //高级筛选-导出【普通用户】
        Route::post('get_user_id_export', 'getUserIdExport'); //高级筛选-导出【普通用户id集合】
        Route::post('get_consultant_id_export', 'getConsultantIdExport'); //高级筛选-导出【获取咨询师ID】
        Route::post('one_question_type', 'OneQuestionType'); //按问题分类统计-个人
        Route::post('consultant_senior_export', 'consultantSeniorExport'); //高级筛选-导出【咨询师】
        Route::post('one_reception_capacity', 'OneReceptionCapacity'); //累计接待人数统计-个人
        Route::post('one_month_people_number', 'OneMonthPeopleNumber'); //月度人数统计-个人
    })->prefix($prefix.'.config.Index/');

});

//区域量表库
Route::group('rating_scale',function () {
    //区域所有用户列表
    $prefix = 'rating_scale.general.';
    Route::group('general', function () {
        Route::post('list', 'list'); //列表
        Route::post('add', 'add'); //新增量表
    })->prefix($prefix.'RatingScale/');
});

//区域量表测评
Route::group('task',function () {
    //发布区域任务
    $prefix = 'task';
    Route::group('publish', function () {
        Route::post('publish_task', 'PublishTask'); //发布任务
        Route::post('rating_scale_selector', 'RatingScaleSelector'); //量表选择器
        Route::post('unit_selector', 'UnitSelector'); //单位选择器
        Route::post('unit_linkage', 'UnitLinkage'); //单位联动器
        Route::post('id_get_unit', 'IdGetUnit'); //单位id获取单位列表
    })->prefix($prefix.'.publish.Index/');
    //区域任务报告
    Route::group('list', function () {
        Route::post('index', 'index'); //任务列表
        Route::post('rating_scale', 'RatingScale'); //任务量表
        Route::post('unit', 'unit'); //任务单位
        Route::post('end', 'end'); //终止任务
        Route::post('del', 'del'); //删除任务
        Route::post('info', 'info'); //任务详情
        Route::post('update', 'update'); //编辑任务
        Route::post('update2', 'update2'); //编辑任务
        Route::post('unit_selector', 'UnitSelector'); //任务详情-单位选择器
        Route::post('unit_linkage', 'UnitLinkage'); //任务详情-单位联动器
        Route::post('unit_task_info', 'UnitTaskInfo'); //单位任务详情
        Route::post('task_group_report', 'TaskGroupReport'); //任务测评团体报告
    })->prefix($prefix.'.list.TaskList/');
});


//区域量表测评-报告
Route::group('report',function () {
    //下级报告
    $prefix = 'report';
    //首页
    Route::group('index', function () {
        Route::post('index', 'Index');
    })->prefix($prefix.'.subset.Index/');
    //自我测评
    Route::group('self_report', function () {
        Route::post('index', 'Index');//主页
    })->prefix($prefix.'.subset.SelfReport/');
    //任务测评
    Route::group('task_report', function () {
        Route::post('index', 'Index');
    })->prefix($prefix.'.subset.TaskReport/');
    //他人代测
    Route::group('proxy_report', function () {
        Route::post('index', 'Index');
    })->prefix($prefix.'.subset.ProxyReport/');
    //预警报告
    Route::group('warning_report', function () {
        Route::post('index', 'Index');
    })->prefix($prefix.'.subset.WarningReport/');
    //解读报告
    Route::group('explain_report', function () {
        Route::post('index', 'Index');
    })->prefix($prefix.'.subset.ExplainReport/');
    //选择器
    Route::group('selector', function () {
        Route::post('rating_scale_type_selector', 'RatingScaleTypeSelector');//量表类型选择器
        Route::post('publisher_selector', 'PublisherSelector');//发布人身份选择器
        Route::post('proxy_user_selector', 'proxyUserSelector');//代测人选择器
        Route::post('admin_selector', 'adminSelector');//管理选择器
        Route::post('admin_selector2', 'adminSelector2');//管理选择器(含咨询师)
        Route::post('department_selector', 'DepartmentSelector');//部门选择器
        Route::post('warning_search', 'WarningSearch');//预警报告-搜索栏
    })->prefix($prefix.'.subset.Selector/');
});


//统计
Route::group('statistics',function () {
    $prefix = 'statistics';
    //量表
    Route::group('rating_scale', function () {
        Route::post('warning_people_num', 'WarningPeopleNum');//预警结果统计
        Route::post('result', 'result');//累计测评结果统计
        Route::post('month_trend', 'MonthTrend');//当月测评人数走势
        Route::post('comprehensive', 'comprehensive');//累计综合数据统计
        Route::post('user', 'user');//累计用户数量统计
        Route::post('scl90', 'scl90');//SCL-90指标统计
    })->prefix($prefix.'.rating_scale.Index/');
    //咨询
    Route::group('consult', function () {
        Route::post('month_online_end_num', 'MonthOnlineEndNum');//本月咨询完结人数
        Route::post('month_offline_end_num', 'MonthOfflineEndNum');//本月预约完结人数
        Route::post('year_trend', 'YearTrend');//全年人数走势图
        Route::post('num', 'num');//咨询/预约次数
        Route::post('crowd', 'crowd');//咨询服务覆盖人群统计
        Route::post('question_type', 'QuestionType');//问题类型数据统计
    })->prefix($prefix.'.consult.Index/');
    //危机干预
    Route::group('crisis_intervention', function () {
        Route::post('number_people', 'NumberPeople');//危机人数统计
        Route::post('men_women', 'MenWomen');//危机男女比率
        Route::post('exception', 'Exception');//异常类型
        Route::post('question_type', 'QuestionType');//问题类型人数统计
        Route::post('personnel_distribution', 'PersonnelDistribution');//危机人员分布统计
        Route::post('staff', 'staff');//危机干预及重点关注人员统计
    })->prefix($prefix.'.crisis_intervention.Index/');
    //危机干预-月报
    Route::group('crisis_intervention_month', function () {
        Route::post('month_add_data', 'MonthAddData');//本期新增数据-月报
        Route::post('month_sex_ratio', 'MonthSexRatio');//本月干预人员中男女比例-月报
        Route::post('month_exception', 'MonthException');//本期异常情况统计-月报
        Route::post('crisis_type_selector', 'CrisisTypeSelector');//疑似问题类型选择器
        Route::post('monthly_report', 'MonthlyReport');//危机干预月报导出
    })->prefix($prefix.'.crisis_intervention.MonthlyReport/');

    //首页
    Route::group('home', function () {
        Route::post('areas', 'areas');//辖区数据
        Route::post('index', 'Index');//主页数据统计
    })->prefix($prefix.'.home.Index/');

    //总统计（包含老版数据）
    Route::group('all', function () {
        Route::post('user_number_people', 'userNumberPeople');//用户比例统计
        Route::post('user_online', 'userOnline');//用户在线活跃度
        Route::post('user_age', 'userAge');//用户年龄段细分

        Route::post('warning_people_num', 'warningPeopleNum');//预警结果统计
        Route::post('result_num', 'resultNum');//累计测评结果统计
        Route::post('month_trend', 'monthTrend');//当月测评人数走势
        Route::post('interfere_number_people', 'interfereNumberPeople');//危机人数统计
        Route::post('interfere_men_women', 'interfereMenWomen');//危机男女比率
        Route::post('interfere_exception_type', 'interfereExceptionType');//异常类型
        Route::post('interfere_question_type', 'interfereQuestionType');//问题类型人数统计
        Route::post('interfere_staff', 'interfereStaff');//危机干预及重点关注人员统计
        Route::post('consult_month_online_end_num', 'consultMonthOnlineEndNum');//本月咨询完结人数
        Route::post('consult_month_offline_end_num', 'consultMonthOfflineEndNum');//本月预约完结人数
        Route::post('consult_year_trend', 'consultYearTrend');//全年人数走势图
        Route::post('consult_num', 'consultNum');//咨询/预约次数
        Route::post('consult_question_type', 'consultQuestionType');//问题类型数据统计
        Route::post('evaluation', 'evaluation');//测评总数统计
        Route::post('user', 'user');//用户总数统计
        Route::post('comprehensive', 'comprehensive');//累计综合数据统计

        Route::post('evaluation2', 'evaluation2');//测评总数统计（区域版）
        Route::post('user2', 'user2');//用户总数统计（区域版）
        Route::post('evaluation3', 'evaluation3');//测评总数统计（单位）
        Route::post('user3', 'user3');//用户总数统计（单位）
    })->prefix($prefix.'.all.Index/');
});

//咨询
Route::group('consult',function () {
    $prefix = 'consult';
    //主页
    Route::group('index', function () {
        Route::post('index', 'Index');
    })->prefix($prefix.'.subset.Index/');
    //线上咨询记录
    Route::group('online', function () {
        Route::post('index', 'Index');
        Route::post('online_advanced_filtering_export', 'onlineAdvancedFilteringExport');//线上高级筛选导出
    })->prefix($prefix.'.subset.Online/');
    //线下预约记录
    Route::group('offline', function () {
        Route::post('index', 'Index');
        Route::post('offline_advanced_filtering_export', 'offlineAdvancedFilteringExport');//线下高级筛选导出
    })->prefix($prefix.'.subset.Offline/');
    //咨询/预约黑名单
    Route::group('black_list', function () {
        Route::post('index', 'Index');
        Route::post('export_blacklist', 'exportBlacklist');
    })->prefix($prefix.'.subset.BlackList/');
    //咨询师排班情况
    Route::group('scheduling', function () {
        Route::post('index', 'Index');
    })->prefix($prefix.'.subset.Scheduling/');
    //配置
    Route::group('config', function () {
        Route::post('question_selector', 'questionSelector');//问题类型选择器
        Route::post('consult_online_selector', 'ConsultOnlineSelector');//线上咨询记录-咨询师选择器
        Route::post('consult_offline_selector', 'ConsultOfflineSelector');//线下预约记录-咨询师选择器
        Route::post('rating_scale_selector', 'ratingScaleSelector');//量表选择器
    })->prefix($prefix.'.config.Index/');
});

//消息
Route::group('message',function () {
    $prefix = 'message';
    //推送
    Route::group('push', function () {
        Route::post('push_message', 'PushMessage');//推送消息
        Route::post('push_message_list', 'PushMessageList');//推送历史记录
        Route::post('push_message_del', 'PushMessageDel');//推送历史记录-删除
    })->prefix($prefix.'.push.Index/');
});


//危机干预
Route::group('crisis_intervention',function () {
    $prefix = 'crisis_intervention';
    //主页
    Route::group('index', function () {
        Route::post('index', 'Index');//列表
    })->prefix($prefix.'.list.Index/');
    //关注人群
    Route::group('follow', function () {
        Route::post('index', 'Index');//列表
        Route::post('follow_user_export', 'FollowUserExport');//批量导出关注人群
        Route::post('follow_user', 'FollowUser');//关注人群高级筛选
    })->prefix($prefix.'.list.Follow/');
    //干预人群
    Route::group('interfere', function () {
        Route::post('index', 'Index');//列表
        Route::post('interfere_user_export', 'InterfereUserExport');//批量导出干预人群
        Route::post('interfere_user', 'InterfereUser');//干预人群高级筛选
    })->prefix($prefix.'.list.Interfere/');
    //完成档案
    Route::group('archives', function () {
        Route::post('index', 'Index');//列表
        Route::post('interfere_user_archives_export', 'InterfereUserArchivesExport');//批量导出干预完成档案
        Route::post('interfere_user_archives', 'InterfereUserArchives');//干预完成档案高级筛选
    })->prefix($prefix.'.list.Archives/');
    //配置
    Route::group('config', function () {
        Route::post('crisis_measures_selector', 'CrisisMeasuresSelector');//干预措施选择器
        Route::post('crisis_behavior_selector', 'CrisisBehaviorSelector');//异常行为表现选择器
        Route::post('crisis_level_selector', 'CrisisLevelSelector');//风险等级评估选择器
        Route::post('crisis_type_selector', 'CrisisTypeSelector');//疑似问题类型选择器
        Route::post('follow_search', 'FollowSearch');//关注人群-搜索栏
        Route::post('interfere_search', 'InterfereSearch');//干预人群-搜索栏
        Route::post('rating_scale_selector', 'ratingScaleSelector');//量表选择器
    })->prefix($prefix.'.config.Index/');
});

//平台配置
Route::group('config',function () {
    $prefix = 'config';
    //软件设置
    Route::group('software', function () {
        Route::post('get_platform', 'getPlatform');//软件设置-获取信息
        Route::post('set_platform', 'setPlatform');//软件设置-设置
        Route::post('get_platform_landscape', 'getPlatformLandscape');//数据大屏设置-获取信息
        Route::post('set_platform_landscape', 'setPlatformLandscape');//数据大屏设置-设置
        Route::post('get_platform_info', 'getPlatformInfo');//获取平台信息
        Route::post('set_platform_info', 'setPlatformInfo');//更新平台信息

        Route::post('get_company', 'getCompany');//软件设置-获取信息-公司
        Route::post('set_company', 'setCompany');//软件设置-设置-公司
        Route::post('get_company_landscape', 'getCompanyLandscape');//数据大屏设置-获取信息-公司
        Route::post('set_company_landscape', 'setCompanyLandscape');//数屏据大设置-设置-公司
        Route::post('get_company_info', 'getCompanyInfo');//获取平台信息-公司
        Route::post('set_company_info', 'setCompanyInfo');//更新平台信息-公司

        Route::post('get_unit_info', 'getUnitInfo');//获取单位配置信息
    })->prefix($prefix.'.software.Index/');
});




